Skip to content

Conversation

@ns5678
Copy link
Contributor

@ns5678 ns5678 commented Jul 31, 2025

Added a section on PyTorch-Warp interoperability towards the end of Chapter 12 notebook.

"cell_type": "markdown",
"metadata": {},
"source": [
"Let us define the backward function for our optimization and register it using `register_autograd` for our `warp_rosenbrock` operator"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there's sort of a plummet in quality after this and we just have the reader execute code block after code block, not expecting if they should see anything after executing one or what the code block is doing. Are you able to improve the flow (from your perspective as someone who probably hasn't seen this example before)?

"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "undefined.undefined.undefined"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how it got to be "version": "undefined.undefined.undefined"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what happened there. In my current push, it shows 3.11.11

"metadata": {},
"outputs": [],
"source": [
"# Our backward functions is warp_rosenbrock_backward, being wrapped def backward(...) wraps it\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • functions -> function
  • warp_rosenbrock_backward -> warp_rosenbrock_backward
  • "being wrapped def backward(...) wraps it" is kind of a nonsense comment

Copy link
Contributor Author

@ns5678 ns5678 Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol, what was I thinking writing that comment in the third bullet, fixed now

]
},
{
"cell_type": "code",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need a markdown cell before each block of code that explains what the following code block does

"cell_type": "markdown",
"metadata": {},
"source": [
"In the GIF above, the red star represents the optimum, the white dot shows the mean of $(x, y)$ coordinates across all 1500 points, and the black dots are the individual points. As the optimization progresses, both the white dot and the individual black dots converge toward the red star, validating our hybrid PyTorch-Warp optimization scheme for the Rosenbrock function."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be some acknowledgement here about the simplicity of the example. The PyTorch custom operator was extremely simple and this optimization problem can be easily done in PyTorch without going to a kernel-based framework like Warp. We should have the reader recognize that instead of simplify evaluating a function, their custom operators might contain entire simulators with multiple kernel launches that might also use Warp's built-in spatial data structures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants